package com.simon.adapter.adapter;

import com.cmonbaby.adapter.recycleview.RViewHolder;
import com.cmonbaby.adapter.recycleview.base.RItem;
import com.simon.adapter.R;
import com.simon.adapter.entity.ChatMessage;

class MsgSendItemDelagate implements RItem<ChatMessage> { // LItem

    @Override
    public int getItemViewLayoutId() {
        return R.layout.main_chat_send_msg;
    }

    @Override
    public boolean isForViewType(ChatMessage item, int position) {
        return !item.isComMeg();
    }

    @Override
    public void convert(RViewHolder holder, ChatMessage chatMessage, int position) { // LViewHolder
        holder.setText(R.id.chat_send_content, chatMessage.getContent());
        holder.setText(R.id.chat_send_name, chatMessage.getName());
        holder.setImageResource(R.id.chat_send_icon, chatMessage.getIcon());
    }
}
